<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title>fuint系统研发中心 - 登录</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/>
    <meta content="" name="description"/>
    <meta content="" name="author"/>
    <link rel="icon" href="${rc.contextPath}/static/assets/favicon.ico">
    <link href="${rc.contextPath}/static/assets/plugins/bootstrap/css/bootstrap.min.css?v=1.0.0" rel="stylesheet"/>
    <link href="${rc.contextPath}/static/assets/css/style.css?v=1.0.0" rel="stylesheet"/>
</head>
<body class="pace-top login-bg">

<!-- begin #page-container -->
<div id="page-container" class="fade">
    <!-- begin login -->
    <div class="login login-with-news-feed">
        <div class="news-feed">
            <div class="news-image">
                <img src="${rc.contextPath}/static/img/bg.png" data-id="login-cover-image"/>
            </div>
        </div>
        <!-- begin right-content -->
        <div class="right-content">
            <div class="login-header">
                <div class="brand">
                    <img class="logo" src="${rc.contextPath}/static/img/logo.png">
                    <span class="name">fuint系统研发中心</span>
                </div>
                <div class="icon">
                    <i class="fa fa-sign-in"></i>
                </div>
            </div>
            <!-- begin login-content -->
            <div class="login-content">
                <form action="${rc.contextPath}/login" method="POST" id="loginAction" name="loginAction" class="margin-bottom-0">
                    <label style="font-size:14px;padding: 5px;color: #FF0000 ">${loginError}</label>
                    <div class="form-group m-b-15">
                        <input type="text" name="username" id="username" class="form-control input-lg" value="fuint" placeholder="用户名"/>
                    </div>
                    <div class="form-group m-b-15">
                        <input type="password" id="password_text" class="form-control input-lg" placeholder="密码" value="123456" name="password_text"/>
                        <input type="hidden" id="password" placeholder="密码" value="" autocomplete="off" name="password"/>
                    </div>
                    <div class="form-group m-b-15">
                        <img alt="验证码" src="${rc.contextPath}/captcha/getCode?math=" +Math.random()
                             width="118" height="46"
                             onclick="this.src='${rc.contextPath}/captcha/getCode?math='+Math.random()"/>
                        <div class="form-group m-b-20" style="float: left;margin-right:20px">
                            <input name="captcha" id="captcha" type="text" value="" placeholder="验证码" class="form-control input-lg"/>
                        </div>
                    </div>
                    <div class="login-buttons">
                        <button type="button" onclick="formSubmit();" class="btn btn-success btn-block btn-lg"><i class="fa fa-sign-in"></i>立即登录</button>
                    </div>
                    <hr/>
                    <p class="text-center text-inverse">
                        &copy; 延禾技术 <a target="_blank" href="https://www.fuint.cn">fuint.cn</a> All Right Reserved 2020 - 2022
                    </p>
                </form>
            </div>
            <!-- end login-content -->
        </div>
    </div>
<script src="${rc.contextPath}/static/assets/plugins/jquery/jquery-1.9.1.min.js?v=1.0.0"></script>
<script src="${rc.contextPath}/static/assets/plugins/jquery/jquery-migrate-1.1.0.min.js?v=1.0.0"></script>
<script src="${rc.contextPath}/static/assets/plugins/jquery-ui/ui/minified/jquery-ui.min.js?v=1.0.0"></script>
<script src="${rc.contextPath}/static/assets/plugins/bootstrap/js/bootstrap.min.js?v=1.0.0"></script>
<script src="${rc.contextPath}/static/assets/js/apps.min.js?v=1.0.0"></script>
<script src="${rc.contextPath}/static/js/custom/jsencrypt.min.js?v=1.0.0"></script>
<script type="application/javascript">
    $(document).ready(function () {
        App.init();
    });

    $(document).keyup(function(event){
        if(event.keyCode ==13) {
            if ($("#captcha").val().length >= 4) {
                formSubmit();
            }
        }
    });

    function formSubmit() {
        const encrypt = new JSEncrypt();
        encrypt.setPublicKey('${stringUtil.getPublicKey()}');
        const encrypted = encrypt.encrypt( $("#password_text").val());
        $("#password").val(encrypted);
        $("#password_text").val("");
        $("#loginAction").submit();
    }
</script>
</body>
</html>